<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增医生')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-doctor-add">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">医生姓名：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">专业：</label>
                <div class="col-sm-8">
                    <input name="specialty" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">描述：</label>
                <div class="col-sm-8">
                    <input name="descript" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">所属科室：</label>
                <div class="col-sm-8">
                    <select name="departmentId" id="departmentId" class="form-control" required>
                        <!-- 分类选项将通过 JavaScript 动态填充 -->
                        <option th:each="dept:${depts}" th:value="${dept.deptId}"
                                th:text="${dept.deptName}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">所属科室：</label>
                <div class="col-sm-8">
                    <select name="postId" id="postId" class="form-control" required>
                        <!-- 分类选项将通过 JavaScript 动态填充 -->
                        <option th:each="post:${posts}" th:value="${post.postId}"
                                th:text="${post.postName}"></option>
                    </select>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">年龄：</label>
                <div class="col-sm-8">
                    <input name="age" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contactNumber" class="form-control" type="text" required>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/doctor"
    $("#form-doctor-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-doctor-add').serialize());
        }
    }
</script>
</body>
</html>